package com.company.cloud.art.modules.app.controller;

import com.company.cloud.art.modules.api.request.ActSignUpAddReq;
import com.company.cloud.art.modules.mgr.service.ActActivityMgrService;
import com.company.cloud.common.auth.annotation.Login;
import com.company.cloud.common.auth.annotation.StaffLogc;
import com.company.cloud.common.bean.BaseResult;
import com.company.cloud.common.bean.LoginSimpleUserInfo;
import com.company.cloud.common.utils.AuthContextUtils;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping("/app/art/activity2signup")
@Api(tags = "ART_活动报名")
public class ActivitySignUpInfoController {

    @Autowired
    private ActActivityMgrService actActivityMgrService;

    @Login
    @PostMapping("/save")
    @ApiOperation(value = "活动报名新增", response = BaseResult.class)
    public BaseResult save(@RequestBody ActSignUpAddReq params) {
        LoginSimpleUserInfo userInfo = AuthContextUtils.getUser();
        params.setUserId(userInfo.getId());
        actActivityMgrService.actSignUpAdd(params, userInfo);
        return BaseResult.ok();
    }


}
